
package conexao;

import java.util.EventObject;



public class ConectEvent extends EventObject{
    
    
    
    protected int id;
    protected String msg;
    public static final int CONECTADO       = 1;
    public static final int DESCONECTADO    = 2;
    public static final int ERRO_CONEXAO    = 3;
    
    public ConectEvent(Object o, int id){
        super(o);
        this.id=id;
    }

    public ConectEvent(String s, int id){
        super(s);
        this.msg = s;
        this.id=id;
    }
    
    public ConectEvent(Object o, int index, int id){
        super(o);
        this.id=id;
    }

    @Override
    public Object getSource(){
        return (source instanceof Object) ? (Object)source : null;
    }
    
    public Object[] getListSource(){
        return (source instanceof Object[]) ? (Object[])source : null;
    }

    public String getMSG(){
        return this.msg;
    }

    public int getID(){
        return this.id;
    }

}
